///////////////////////////////////////////////////////////////////////////
//
// Spring Engine Source File.
// Copyright (C), Dengtao 2011-2021
// ----------------------------------------------------------------------
// File name:   SfMemoryObject.h
// Version:     v1.0.0
// Created:     2013/06/13 22:55 by dengtao
// Compilers:   Visual Studio 2008
// Description: 
// ----------------------------------------------------------------------
// History:
//
///////////////////////////////////////////////////////////////////////////

#ifndef _SfMemoryObject_H_
#define _SfMemoryObject_H_

#include "SfBaseDefines.h"

//
// begin namespace sunflower
namespace Sunflower 
{

//////////////////////////////////////////////////////////////////////////
//Summary:
//	base class for memory management.
//////////////////////////////////////////////////////////////////////////
class MemoryObject
{
public:
	//
	//Summary:
	//	default constructor.
	MemoryObject();

	//
	//Summary:
	//	virtual destructor.
	virtual ~MemoryObject();

	//
	//Summary:
	//	override operator new
	void* operator new(size_t size, const char* file, 
		int line, const char* func);
	void* operator new[](size_t size, const char* file, 
		int line, const char* func);
	
	//
	//Summary:
	//	override operator delete
	static void operator delete(void* p, const char* file,
		int line, const char* func);
	//
	//Summary:
	//	override operator new
	void* operator new(size_t size);
	void* operator new[](size_t size);

	//
	//Summary:
	//	override operator delete
	void operator delete(void* p);
	void operator delete[](void* p);
};

} // end namespace sunflower 

#endif
